<#assign contextPath=springMacroRequestContext.getContextPath() />
<#import "/public/frame/main.html" as frame />
<@frame.head "南航明珠商城-商品列表">
</@frame.head>
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title>订单详情</title>
	<link rel="stylesheet" href="${contextPath}/resources/css/order/reset.css"/>
	<script type="text/javascript" src="${contextPath}/resources/lib/jquery/1.9.1/jquery.js"></script>
	<script type="text/javascript" src="${contextPath}/resources/js/order/safe.js"></script>
	<script type="text/javascript" src="${contextPath}/resources/js/tool/validate.tools.js"></script>
	<script type="text/javascript" src="${contextPath}/resources/js/order/update_sendAddress.js"></script>
	<script type="text/javascript" src="${contextPath}/resources/lib/My97DatePicker/4.8/WdatePicker.js"></script>
	<script type="text/javascript" src="${contextPath}/resources/js/laypage/laypage.js"></script>


	
<body>
	<div class="zp_pop" style="margin-top: 2px;">
		
		<table class="table table-border table-bordered table-bg">
		    <tbody>
		    <!-- 	<tr><td><h1>订单详情</h1></td></tr> -->
		    	<tr><td colspan="4" style="text-align: center;"><font size="2"><b>商品信息</b></font></td></tr>
		    	
		    	<tr >
				<td width="33%">订单号：${order.id}  </td>
				<td width="33%">下单时间：${order.orderTime?date}</td>
				<!-- <td width="20%">用户名：${memberInfo.name}</td> 
				<td width="20%">用户等级：
					<#if memberInfo.mlevel ==  1 >普通卡
					<#elseif  memberInfo.mlevel== 2 >银卡
					<#elseif memberInfo.mlevel ==  3 >金卡
					<#elseif memberInfo.mlevel ==  4 >公司卡
					</#if>
			</td> -->
				<td width="33%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;订单状态：
							<#if order.state==1>未支付
							<#elseif order.state==2>已支付
							<#elseif order.state==3>信息不正确
							<#elseif order.state==4>挂起
							<#elseif order.state==5>发货
							<#elseif order.state==6>已发货 
							<#elseif order.state==7>订单已取消 
							<#elseif order.state==8>已签收 
							<#elseif order.state==9>已退款 
							<#elseif order.state==10>已拒签 
							<#elseif order.state==11>支付处理中 
							<#elseif order.state==12>支付失败 
							<#elseif order.state==13>发放成功 
							<#elseif order.state==14>发放中 
							</#if>
				</td>
			</tr>
			<!-- <tr>
				
				<td>
					订单来源：
					<#if  order.orderSource=="M">
						移动端
					<#else>
						PC端
					</#if>
				</td>
				<#if order.orderType== 3 >
					<td>
						常客订单号：
						${order.skbOrderNo}
					</td>
				</#if>
			</tr> -->
			
		</tbody>
		</table>
		
		<div>
		    <table class="table table-border table-bordered table-bg" style="margin-top: -1px;">
		    
			<tbody><tr class="th_border">
				<th class="zp_t_name" style="text-align: center;" width="50%">商品名称</th>
				
				<th class="zp_t_price"  style="text-align: center;"  width="15%">单价</th>
				<th class="zp_t_num" style="text-align: center;"  width="10%">数量</th>
				<!-- <th class="zp_t_num"   style="text-align: center;" width="10%">颜色</th>
				<th class="zp_t_num"  style="text-align: center;" width="10%">尺寸</th> -->
				<th class="zp_t_wl"  style="text-align: center;" width="10%">物流费用</th>
				<!-- <th class="zp_t_wl"  style="text-align: center;" width="20%">进销存发货编码</th> -->
				<!-- <th width="10%"   style="text-align: center;" class="zp_t_wl">状态</th> -->
				<th class="zp_t_total"  style="text-align: center;" width="15%">小计</th>
				<!-- <th class="zp_t_total"   style="text-align: center;" width="10%">快递公司</th>
				<th class="zp_t_total"   style="text-align: center;" width="10%">快递单号</th> -->
			</tr>
			<#if orderDetailList?? && (orderDetailList?size &gt; 0) >
        	<#list orderDetailList as orderdetil > 
        		  <tr>
				     	    <td>
							  ${orderdetil.product.baseInfo.name}
							</td>
							<#if orderdetil.orderType==3>
							<td>
									 ${order.activeNo}  
							</td>
							</#if>
							<#if  orderdetil.buyType==1 >
							  <td>
							    ${orderdetil.mileages}里程
							  </td>
							</#if>
							
							<#if  orderdetil.buyType==2 >
							  <td>
							       ${orderdetil.mileages}里程+￥ ${orderdetil.prices} 
							  </td>
							</#if>
							<#if  orderdetil.buyType==3 >
							  <td>
							      ￥ ${orderdetil.prices} 
							  </td>
							</#if>
							<td>
							 ${orderdetil.buyNum}  
							</td>
							<!-- <td>
								 ${orderdetil.styleName}     
							</td>
							<td>	
							 ${orderdetil.sizeName}     
							</td> -->
							<td>
							  无
							</td>
							<!-- <td>
							 ${orderdetil.sizesName}    
							   
							</td> -->	
							<td>						
							<#if  orderdetil.buyType==1 >
							  ${orderdetil.mileages*orderdetil.buyNum}里程
							<#elseif orderdetil.buyType==2>
								${orderdetil.mileages*orderdetil.buyNum}里程+￥${(orderdetil.prices*orderdetil.buyNum)?string.number} 
							<#elseif  orderdetil.buyType== 3>
							      ￥${(orderdetil.prices*orderdetil.buyNum)?string.number} 
							</#if>  
							</td>
							<!-- <td>
								${orderdetil.sendName}
							</td>
							
							<td>
								
								${orderdetil.sendNo}
							</td>	 -->												
			     	    </tr>			     	   
		     	    </div>
		     	    <div>
		     	    	<#if orderdetil.presentinfo?? && ( orderdetil.presentinfo?size &gt; 0) >
		     	    	 <td>
			     	    	【赠品】：
			     	    	  <#list  presentMap ?keys as key> 
			  		 			${key}X	${presentMap[key]} <br/>   
			    	 		 </#list>
			     	    </td>
			     	    </#if>	
		     	    </div>
	     	   <!--  </s:iterator>
     	    </s:else> -->
     	    
        	</#list>
        	<#else>  <tr><td colspan="6" align="center">暂无订单明细信息</td></tr>
        	</#if>
			<!-- <s:if test=" orderDetailList== null || orderDetailList.isEmpty()">
			        <s:div><tr><td colspan="6" align="center">暂无订单明细信息</td></tr></s:div>  
     	    </s:if> -->
     	    
     	</tbody></table>
     	
     	     <div style="height: 25px;text-align: right;vertical-align: middle;">
	     	  商品总价(含运费)：${order.orderPayInfo.mileages}&nbsp;&nbsp;
	     	   赠品：无&nbsp;&nbsp;&nbsp;
     	    </div> 
     	
     	<table class="table table-border table-bordered table-bg" >
     	
     
     	<#if  order.orderType==1> 
	 
		<tr><td colspan="5" style="text-align: center;"><font size="2"><b>配送与物流信息</b></font></td></tr>
		    	
		<tr>
		   <td>  收货人：${order.receiveInfo.recName}</td>
		   <td>  电话号码：${ order.receiveInfo.recPhone}</td>
		   <td>  手机号码：${order.receiveInfo.recMobil}</td>
		   <td>  配送地址：${order.receiveInfo.provCityArea} ${order.receiveInfo.recAddress}</td>
		   <td>  邮编：${order.receiveInfo.recPostno}</td>
         </tr>
		
			<tr>
				<td colspan="5" style="text-align: left;">
			    配送时间：<#if  order.sendTime== 0 >时间不限
				  <#elseif order.sendTime==1>工作日送货 
				  <#elseif order.sendTime==2>节假日送货  
				 </#if>
				 </td>
			</tr>
		</#if>
		<#if order.orderType==2>
		<tr><td colspan="3" style="text-align: center;"><font size="2"><b>订单信息</b></font></td></tr>
		 <tr >
		 <td>    商品类型：虚拟商品   </td>
		  <td>
		     电子码信息   
		 </td>
		 <td>接收电子码手机号：${order.xn_phone}  </td>
		 </tr>
		
		</#if>	
		<#if  order.orderType==3>
		 
			 	<tr><td colspan="3" style="text-align: center;"><font size="2"><b>订单信息<</b></font></td></tr>
		 <tr>
		 	<td>商品类型：机票优惠券</td>   
		    <td>备注：${order.remark}</td>
		    
				    
		 </tr>
		 	<#if  presentMap?? &&  ( presentMap?size &gt; 0)>
			 
			<tr><td  style="text-align: center;"><font size="2"><b>赠品信息 </b></font></td></tr>
			<td>
        	   	   <#list  presentMap ?keys as key> 
			  		 	${key}X	${presentMap[key]} <br/>   
			      </#list>
			</td>
			</#if>		
	
		</#if>
		

		
		<#if  order.orderType== 4>
			<#if  order.orderOtherTypeDetail.orderSubType==1 >
				<tr><td colspan="7" style="text-align: center;"><font size="2"><b>购票信息 </b></font></td></tr>
				
				<tr>
				<td>计划乘机日期：${order.orderOtherTypeDetail.startDate?date} </td>
				<td>出发城市：${order.orderOtherTypeDetail.fromCity} </td>
				<td>到达城市：${order.orderOtherTypeDetail.toCity} </td>
				<td>乘机人姓名：${order.orderOtherTypeDetail.guestName} </td>
				<td>乘机人身份证号：${order.orderOtherTypeDetail.guestIdNum} </td>
				<td>付款人姓名：${order.orderOtherTypeDetail.payUserName} </td>
				<td>联系手机号：${order.orderOtherTypeDetail.contactPhone} </td>
		 		</tr>
			<#elseif  order.orderOtherTypeDetail.orderSubType==2 >
				<tr><td colspan="3" style="text-align: center;"><font size="2"><b>升舱信</b></font></td></tr>
				<tr>
				<td>机票票号：${order.orderOtherTypeDetail.airTicketNum} </td>
				<td>升舱支付人：${order.orderOtherTypeDetail.payUserName} </td>
				<td>联系手机号： ${order.orderOtherTypeDetail.contactPhone}</td>
				</tr>
			 </#if>
		</#if>
		
		
		</table>
	
		<div align="center">
		<table class="table table-border table-bordered table-bg" style="margin-top: -1px;">
			<tr><td colspan="6" style="text-align: center;"><font size="2"><b>其他信息</b></font></td></tr>
		 	<#if order.orderType==1>
		 		<tr><td colspan="6" style="text-align: left;">商品类型：实物</td></tr>
		 	</#if>
			<tr><td colspan="6" style="text-align: left;">备注：  ${order.remark}   </td></tr>
			<!-- <tr><td colspan="6" style="text-align: center;"><font size="2"><b>操作日志</b></font></td></tr>
			<tr class="text-c">
					<td  width="20%">操作用户</td>
					<td  width="20%">操作管理员</td>
					<td  width="20%">操作内容</td>
					<td  width="20%">操作时间</td>
					<td  width="20%">退换货/退款记录id</td>
					<td  width="20%"></td>
			</tr>
				<#if  orderLogList?? &&  ( orderLogList?size &gt; 0)>
				<#list  orderLogList as ologList > 
				<tr class="text-c">
				<td>${ologList.memberNo }</td>
				<td>
					<#if ologList.userId == 0 >进销存通知 
					<#else>${ologList.userId} 
					</#if>
				</td>
				<td>
					<#if ologList.operateType == "8-4">换货处理中
					<#elseif ologList.operateType == "10-3">退货处理中
					<#elseif ologList.operateType == "10-4">换货处理中
					<#elseif ologList.operateType == "10-7">换货已入库
					<#elseif ologList.operateType == "10-8">换货已出库
					<#elseif ologList.operateType == "8-7">换货已入库
					<#elseif ologList.operateType == "8-8">换货已出库
					<#elseif ologList.operateType == "8-6">换货已签收
					<#elseif ologList.operateType == "8-3">退货处理中
					<#elseif ologList.operateType == "8-11">待审核
					<#elseif ologList.operateType == "6-11">待审核
					<#elseif ologList.operateType == "10-6">换货已签收
					<#elseif ologList.operateType == "8-5">退货已入库
					<#elseif ologList.operateType == "10-5">退货已入库
					<#elseif ologList.operateType == "10-11">待审核
					<#elseif ologList.operateType == "00">退款成功
					<#elseif ologList.operateType == "0">申请退款
					<#elseif ologList.operateType == "1">下单
					<#elseif ologList.operateType == "2" && operateType.userId??>支付
					<#elseif ologList.operateType == "2" && operateType.userId??>信息处理成功
					<#elseif ologList.operateType == "3">标识为信息不正确
					<#elseif ologList.operateType == "4">挂起
					<#elseif ologList.operateType == "5">发货中
					<#elseif ologList.operateType == "6">已发货
					<#elseif ologList.operateType == "7">取消订单
					<#elseif ologList.operateType == "8">签收
					<#elseif ologList.operateType == "10">拒签
					<#elseif ologList.operateType == "11">支付处理中
					<#elseif ologList.operateType == "12">支付失败
				    <#elseif ologList.operateType == "13">发放成功
				    <#elseif ologList.operateType == "14">发放中
				    </#if>
				</td>
				<td>
					${ologList.operateTime?date}
				</td>
				<td>
					${ologList.remark }
				</td>
				</tr>
				</#list>
				</#if>	 -->
					
				</table>
		<form method="post" name="update_form"  id="update_form" action="${contextPath}/tbOrder/update_order_info_send_address">
		<table  class="table table-border table-bordered table-bg" style="margin-top:-1px;">
		<#if order.orderType==2>
			<tr><td colspan="3" style="text-align: center;"><font size="2"><b>修改收货人信息</b></font></td></tr>
			<tr style="text-align: left;">
			<td colspan="3"style="text-align: left;">
			接收电子码手机号：<input type="text"  class="input-text  radius"  id="xn_phone" name="xn_phone" value="${order.xn_phone}" style="width:150px;"/></td>
			</td>
			</tr>
		<#else>
		<tr><td colspan="3" style="text-align: center;"><font size="2"><b>配送与物流信息编辑</b></font></td>
		</tr>
		 	
		
		<tr>
		         <td> 收货人：<input type="text"  class="input-text  radius"  id="receiver" name="receiver" value="${order.receiveInfo.recName}" style="width:150px;"/> </td>
				 <td>  手机号码 ：<input type="text" class="input-text  radius"  id="mobile" name="mobile" value="${ order.receiveInfo.recMobil}" style="width:150px;"/></td>
		          <td>电话号码：<input style="width:60px;" type="text" class="input-text  radius"  id="quhao"  name="quhao"  value="${ order.receiveInfo.recPhone?split('-')[0]}"/> - <input type="text"  class="input-text  radius" id="telphone" name="telphone" value="${ order.receiveInfo.recPhone?split('-')[1]}" style="width:120px;"/> - <input type="text" class="input-text  radius"  id="extensionTel" name="extensionTel" value="${ order.receiveInfo.recPhone?split('-')[2]}" style="width:60px;"/></td>
		 </tr>       
		   	<tr> <td colspan="2" style="text-align: left;">      配送地址 ：
		   	<select name="provId" id="provId" onchange="changeProvCityArea(1,this.value);" style="width:100px;"> 
		          <option  value="">请选择省</option>
		          <#if basProv?? && (basProv?size &gt; 0) >
        		  <#list basProv as provs >
        		  	  <option   <#if  order.receiveInfo.recProvId ==provs.provId > selected="selected"</#if> value="${provs.provId}">${provs.provName}</option>
        		  </#list>
		          </#if>
		          </select> 
		          <select name="cityId" id="cityId" onchange="changeProvCityArea(2,this.value);" style="width:120px;"> 
		          <option   value="">请选择市</option>
		         <#if basCity?? && (basCity?size &gt; 0) >
        		  <#list basCity as citys >
        		  	<#if citys.provId ==order.receiveInfo.recProvId >   <option   <#if  order.receiveInfo.recCityId ==citys.id  > selected="selected"</#if> value="${citys.id}">${citys.cityName}</option></#if>
		           </#list>
		          </#if>
		          </select>
		          <select name="areaId" id="areaId" style="width:120px;"> 
		          <option value="">请选择区</option>
		          <#if basArea?? && (basArea?size &gt; 0) >
        		  <#list basArea as areas >
        		  	  <#if  order.receiveInfo.recCityId == areas.cityId > <option   <#if  order.receiveInfo.recAreaId ==areas.areaId > selected="selected"</#if> value="${areas.areaId}">${areas.areaName}</option></#if>
		           </#list>
		          </#if>
		          </select>
		          </td>
		          <td> 详细地址：<input style="width:300px;" class="input-text  radius" name="address" value="${order.receiveInfo.recAddress}" type="text" id="address"/></td> 	
		        
		         </tr> 
		    <tr>         
		      <td colspan="3" style="text-align: left;">    邮编：<input style="width:200px;"  class="input-text  radius" name="zipCode" type="text"   id="zipCode" value="${order.receiveInfo.recPostno}"/>  &nbsp;&nbsp;&nbsp;
        		<input type="hidden" id="provCityArea" name="provCityArea"  value="" />
        		</td> 
        </tr>
        </#if>
			<tr style="text-align: left;">
			<td colspan="3"><!--     配送时间：<#if  order.sendTime== 0 >时间不限
				  <#elseif order.sendTime==1>工作日送货 
				  <#elseif order.sendTime==2>节假日送货  
				 </#if> -->
				 <input type="hidden" id="orderType" name="orderType"  value="${order.orderType}" />
				 <input class="input-text  radius" type="hidden" id="orderNo" name="orderNo"  value="${order.id}" />
				 <input type="button" value="修改"  class="btn btn-success radius" onclick="updateSendAddress()"/></td>
			</tr>
 			</form>
	 </table>
		
</div>
	</div></div>
	<input  hidden="hidden" id="basProvJson" value='${basProvJson}'>
	<input  hidden="hidden" id="basCityJson" value='${basCityJson}'>
	<input  hidden="hidden" id="basAreaJson" value='${basAreaJson}'>

</body>
<script type="text/javascript">

	var basProvList = $("#basProvJson").val()  ;
	var basCityList = $("#basCityJson").val() ;
	var basAreaList = $("#basAreaJson").val() ;   
	function changeProvCityArea(state ,No){
		if(state==1){
			selProv(No);
		}
		if(state==2){
			selCity(No);
		}
		if(state==3){
			selArea(No);
		}
		
		
	}
//选择市区	
function selProv(No){
	var json =jQuery.parseJSON(basCityList);
	$("#cityId").empty(); 
	$("#areaId").empty();
	$("#areaId").html('<option value="">请选择市</option>'); 
	var addHtml="";
	addHtml+= '<option value="">请选择市</option>';
	for (var int = 0; int < json.length; int++) {
		if(No==json[int]['provId']){  
			addHtml+= '<option value="'+json[int]['id']+'">'+json[int]['cityName']+'</option>';
		}
	}
	 $("#cityId").html(addHtml); 
	
}	
//选择县区区	
function selCity(No){
	var json =jQuery.parseJSON(basAreaList);
	$("#areaId").empty(); 
	var addHtml="";
	addHtml+= '<option value="">请选择区</option>';
	for (var int = 0; int < json.length; int++) {
		if(No==json[int]['cityId']){  
			addHtml+= '<option value="'+json[int]['areaId']+'">'+json[int]['areaName']+'</option>';
		}
	}
	 $("#areaId").html(addHtml); 
	
}	
</script>
</html>